package com.jie.array;

import java.util.Arrays;
//冒泡排序
public class ArrayDemo08 {
    public static void main(String[] args) {
        int[] array=new int[]{46,64,78,64,1,545,2,54};
        for (int i = 0; i < array.length-1; i++) {
            for (int j = 0; j < array.length-1-i; j++) {
                if (array[j]>array[j+1]){
                    int temp=0;
                    temp =array[j];
                    array[j]=array[j+1];
                    array[j+1]=temp;
                }
            }
        }
        System.out.println(Arrays.toString(array));
    }


}
